package com.base.util.javautils.view;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import org.xutils.x;

/**
 * view注入接口
 *
 * @author gj
 */
public final class ViewInjector {

    /**
     * 注入view
     *
     * @param view
     */
    public static void inject(View view) {
        x.view().inject(view);
    }

    /**
     * 注入activity
     *
     * @param activity
     */
    public static void inject(Activity activity) {
        x.view().inject(activity);
    }

    /**
     * 注入view holder
     *
     * @param handler view holder
     * @param view
     */
    public static void inject(Object handler, View view) {
        x.view().inject(handler, view);
    }

    /**
     * 注入fragment
     *
     * @param fragment
     * @param inflater
     * @param container
     * @return
     */
    public static View inject(Object fragment, LayoutInflater inflater, ViewGroup container) {
        return x.view().inject(fragment, inflater, container);
    }
}

